﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BCGC.BLL.Helper;
using Jalal.Library.Utility;
using BCGC.BLL.BusinessObject.UserAccount;

public partial class Verify : PublicBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        VerifyRegistration();
    }

    private void VerifyRegistration()
    {
        string verificationCode = null;
        if (!string.IsNullOrEmpty(Request.QueryString["vc"]))
            verificationCode = Security.BindStringInput(Request.QueryString["vc"], SecurityLevel.Three);

        if (verificationCode != null)
        {
            if (SiteUser.VerifyRegistration(verificationCode))
                ltlVerifyMessage.Text = "Your registration is complete. Your account is verified. You can now <a href='"
                    + ResolveUrl(CustomSiteMap.Login) + "'>login.</a> Thank you.";
            else
                ltlVerifyMessage.Text = "Sorry, Invalid verification request.";
        }
        else
        {
            ltlVerifyMessage.Text = "Sorry, Invalid verification request.";
        }
    }
}
